package it.unicam.fishpass.prism;

import java.util.ArrayList;

/**
 * Arc of an EPDTA. Contains a <code>Guard</code>, a label, an
 * <code>Assign</code>, a probability value and a clock reset
 * <code>ArrayList</code>. A <code>boolean</code> flag indicates if the arc is
 * urgent or not.
 * 
 * An object of this class is only a <i>part</i> of a multiarc edge in the
 * EPDTA, i.e. it's probability is strictly less than 1. However, multiarc with
 * just one arc (and probability 1) are also possible.
 * 
 * @author Andrea Baiocco
 */
public class Edge {

	final private Guard guard;
	final private Float prob;
	final private String label;
	final private ArrayList<Assign> assignment;
	final private ArrayList<Integer> reset;
	final private Boolean isUrgent;

	/**
	 * @param guard
	 * @param prob
	 * @param var
	 * @param assignment
	 * @param reset
	 * @param isUrgent
	 */
	public Edge(Guard guard, Float prob, String label,
			ArrayList<Assign> assignment, ArrayList<Integer> reset,
			Boolean isUrgent) {
		this.guard = guard;
		this.prob = prob;
		this.label = label;
		this.assignment = assignment;
		this.reset = reset;
		this.isUrgent = isUrgent;
	}

	/**
	 * @return the guards
	 */
	public Guard getGuard() {
		return guard;
	}

	/**
	 * @return the probability associated to the edge
	 */
	public Float getProbability() {
		return prob;
	}

	/**
	 * @return the variable
	 */
	public String getLabel() {
		return label;
	}

	/**
	 * @return the assignment
	 */
	public ArrayList<Assign> getAssignments() {
		return assignment;
	}

	/**
	 * @return the reset
	 */
	public ArrayList<Integer> getResets() {
		return reset;	
	}

	/**
	 * @return temporal
	 */
	public Boolean isUrgent() {
		return isUrgent;
	}

	@Override
	public String toString() {
		return "valore = " + prob.toString();
	}
}